#include "stdafx.h"
#include "AboutDlg.h"
#include "tinyxml.h"
#include "ustringutils.h"
#include "utimeutils.h"
#include "WorkBenchSetting.h"
USING_LIBSPACE


CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()

BOOL CAboutDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	CWorkBenchSetting& instance = WorkbenchSettingHolder::Instance();
	tstring softtitle = UStrConvUtils::ToTS(  instance["configuration"]["title"].EleVal() );
	this->GetDlgItem(IDC_STATIC_SOFTWARE_INFO)->SetWindowText(softtitle.c_str());
	
	int year;
	UTimeUtils::GetNowDate(&year);
	CString companyinfo;

	//companyinfo =;
	companyinfo.Format(_T("%s Copyright (C) %d"), UStrConvUtils::ToTS(instance["configuration"]["company"].EleVal()).c_str(),year );
	this->GetDlgItem(IDC_STATIC_COMPANY_INFO)->SetWindowText(companyinfo);

	CStatic* pPic = (CStatic*) this->GetDlgItem(IDC_STATIC_PIC_CTRLX);
	if(pPic != NULL)
	{
		CImage img;
		img.Load(_T("resource\\companylog.bmp"));
		pPic->SetBitmap(img.Detach());
	}

	return TRUE;
}
